package org.ring.common.transport;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @since 2024-07-15 20:19
 */
public interface Serialization {

    /**
     * Serialize the object.
     *
     * @param obj target obj
     * @return byte[]
     */
    <T> void serialize(T obj, OutputStream output) throws IOException;

    <T> T deserialize(InputStream inputStream)throws IOException;
}
